import { PRIORITY_VIEW } from "../../../Core/CoreDefine";
import { GCtrl } from "../../../Core/GCtrl";
import GViewBase from "../../../Core/GView/GViewBase";
import { CMsg, RPointMask, SPECIALWINDOW, VIPBOXTYPE, VIPRECEIVE } from "../../Common/Define";
import { VIEW_ID } from "../../Common/UI";
import { Res } from "../../Common/UIResources";
import FriendItem from "../../Item/FriendItem";
import GameMgr from "../../Logic/GameMgr";
import HangPage from "../Common/HangPage";
import TopUiItem from "../Common/TopUiItem";
import VipPage from "./VipPage";


const { ccclass, property, menu, executeInEditMode } = cc._decorator;
@ccclass @menu('View/Home/JuntuanView')

export default class JuntuanView extends GViewBase {

    @property({type: cc.Node, tooltip: "底部按钮模块1"})  to1Btn: cc.Node = null;

    @property({type: cc.Node, tooltip: "底部按钮模块2"})  to2Btn: cc.Node = null;


    selectTog:number = 1;


    onGLoad() {
        this.addHang(1, "军团");
        this.refresh();
    }

    refresh(){
        this.to1Btn.active = this.selectTog == 1;

        this.to2Btn.active = this.selectTog == 2;

        // for (let index = 0; index < this.listContent.children.length; index++) {
        //     const element = this.listContent.children[index];
        //     element.getComponent(FriendItem).setView(this.selectTog);
        // }
    }


    close() {
        this.onClose();
    }

    onClickHanlder(event:Event, str:string){
        if (str == "tog1"){
            this.selectTog = 1
            this.refresh();
        }
        else if (str == "tog2"){
            this.selectTog = 2
            this.refresh();
        }
        else if (str == "ruleBtn"){
            //GameMgr.jumpToMgr.jumpGoTo(VIEW_ID.comonTipView, 4);
        }
    }
}